﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="ManageCompanies.aspx.cs" Inherits="Administration_ManageCompanies"
    CodeFileBaseClass="BaseView" ViewName="ManageCompanies" Title="Crux -  Manage Companies" %>

<%@ Register Src="../Controls/Common/WaterMarkedTextBox.ascx" TagName="WaterMarkedTextBox"
    TagPrefix="crux" %>
<%@ Register Src="../Controls/Common/ErrorNotification.ascx" TagName="ErrorNotification"
    TagPrefix="crux" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="scriptManager" runat="server">
    </asp:ScriptManager>
    <!-- 
        CreativeToDo: The Text Boxes On This Page Don't Change Their BackGround Like Login Page 
             when Validations are not satified 
        -->
    <asp:UpdatePanel ID="updUpdate" runat="server">
        <ContentTemplate>
        <asp:Panel ID="pnlList" runat="server">
            <table cellpadding="0" cellspacing="0" class="toolbar">
    <tr>
    <td>
            
                <asp:ImageButton ID="btnAddNewCompany" runat="server" Text="Add Company" OnClick="btnAddNewCompany_Click" ImageUrl="../App_Themes/DefaultTheme/images/add_company.gif"/>
                </td>
                </tr>
                </table>
<table><tr><td height="12"></td></tr></table>
                <asp:GridView ID="grdCompanies" runat="server" OnRowDataBound="grdCompanies_RowDataBound"
                    AutoGenerateColumns="False">
                    <Columns>
                        <asp:BoundField DataField="CompanyID" HeaderText="Company ID" ItemStyle-CssClass="GridFirstColumn" />
                        <asp:BoundField DataField="CompanyName" HeaderText="Company Name" />
                        <asp:BoundField DataField="CompanyType" HeaderText="Company Type" />
                        <asp:BoundField DataField="CompanyBillingAddress" HeaderText="Billing Address" />
                        <asp:BoundField DataField="CompanyMailingAddress" HeaderText="Mailing Address" />
                        <asp:BoundField DataField="CompanyComments" HeaderText="Company Comments" />
                        <asp:TemplateField HeaderText="Actions" ItemStyle-CssClass="ActionButtons">
                            <ItemTemplate>
                                <center>
                                    <asp:ImageButton ID="btnItemEditIcon" runat="server" CausesValidation="false" CommandName="EditItem"
                                        OnCommand="grdCompanies_RowCommand" CommandArgument='<%#Eval("CompanyID")%>'
                                        ImageUrl="~/appimages/Edit.gif" ToolTip="Edit Company Details" />
                                    <asp:ImageButton ID="btnItemDelete" runat="server" CausesValidation="false" CommandName="DeleteItem"
                                        OnCommand="grdCompanies_RowCommand" CommandArgument='<%#Eval("CompanyID")%>'
                                        ImageUrl="~/appImages/delete.gif" ToolTip="Delete" />
                                    <!-- CreativeTodo: Have Icon For 'Manage Departments' -->
                                    <asp:ImageButton ID="btnManageCompany" runat="server" CausesValidation="false" CommandName="OpenView"
                                        OnCommand="grdCompanies_RowCommand" CommandArgument='<%#Eval("CompanyID")%>'
                                        ImageUrl="~/appimages/manage_company.gif" ToolTip="Manage Company" />
                                </center>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </asp:Panel>
            <asp:Panel ID="pnlAddEdit" runat="server">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td class="formTxtHeader" colspan="2">
                            Company Management
                        </td>
                        
                    </tr>
                    <tr>
                        <td class="formLine" colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formGroupGap">
                        </td>
                    </tr>
                    <!-- Company ID -->
                    <tr>
                        <td align="right" valign="middle" class="formLeftColmnWidth">
                            <asp:Label ID="lblCompanyID" runat="server" Text="Company ID:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <asp:Label ID="lblCompanyIDValue" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Company Name -->
                    <tr>
                        <td align="right" valign="middle" class="formLeftColmnWidth">
                            <asp:Label ID="lblCompanyName" runat="server" Text="Company Name:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtCompanyName" WaterMarkText="Company Name" ValueRequired="true"
                                ErrorText="Company Name is required." Width="180" MaxLength="50" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Company Billing Address -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="lblCompanyBillingAddress" runat="server" Text="Company Billing Address:"
                                CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtCompanyBillingAddress" WaterMarkText="Company Billing Address"
                                ValueRequired="false" TextMode="MultiLine" ErrorText="Company Billing Address is required."
                                Width="180" Height="30" MaxLength="200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Company Mailing Address -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="Label1" runat="server" Text="Company Mailing Address:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtCompanyMailingAddress" WaterMarkText="Company Mailing Address"
                                ValueRequired="false" TextMode="MultiLine" ErrorText="Company Mailing Address is required."
                                Width="180" Height="30" MaxLength="200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Company Type -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="lblCompanyType" runat="server" Text="CompanyType:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <asp:DropDownList ID="drpCompanyType" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Company Comments -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="lblCompanyComments" runat="server" Text="Company Comments:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtCompanyComments" WaterMarkText="Company Comments"
                                ValueRequired="false" MaxLength="10" TextMode="MultiLine" Width="180" Height="30"
                                runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formGroupGap">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td align="left">
                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
                            &nbsp;
                            <asp:Button ID="btnCancel" runat="server" CausesValidation="false" Text="Cancel"
                                OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <crux:ErrorNotification ID="pnlError" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
